$(function() {
	
	$("#modifyForm").validate({
		rules:{
			"captcha": {
				required:true,
				remote: {
					url: "userAction!checkCaptcha", 
					type: "POST", 
					data: {"": ($("#user.email").val())}
				}
			}
		},
		messages:{ 
			"captcha": {
				required: "请输入验证码",
				remote: "验证码输入不正确"
			}
		},
		errorPlacement:function(error, element) {
			error.appendTo(element.parent());
		}, 
		success: function(label) {
			label.html("").addClass("right");
		}
	});
	
	$("#codeimg").click(function() {
		$("#codeimg").attr("src", "../patchca.png?" + new Date());
	});
});